package com.letfox.user.service.relation.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.letfox.user.dao.relation.AccountServiceKeyDao;
import com.letfox.user.model.relation.UAccountServiceKey;
import com.letfox.user.service.relation.AccountServiceKeyService;

@Service
public class AccountServiceKeyServiceImpl implements AccountServiceKeyService {
	
	@Autowired
	private  AccountServiceKeyDao accountServiceKeyDao;

	@Override
	public int save(UAccountServiceKey accountServiceKey) {
		return accountServiceKeyDao.insert(accountServiceKey);
	}

	@Override
	public int update(UAccountServiceKey accountServiceKey) {
		return accountServiceKeyDao.update(accountServiceKey);
	}

	@Override
	public int deleteById(Long id) {
		return accountServiceKeyDao.deleteById(id);
	}

	@Override
	public int deleteByIds(String ids) {
		return accountServiceKeyDao.deleteByIds(ids);
	}

	@Override
	public UAccountServiceKey getById(Long id) {
		return accountServiceKeyDao.selectById(id);
	}

	@Override
	public List<UAccountServiceKey> getList(UAccountServiceKey accountServiceKey) {
		return accountServiceKeyDao.selectList(accountServiceKey);
	}

	@Override
	public UAccountServiceKey getByServiceKey(String serviceKey) {
		return accountServiceKeyDao.selectByServiceKey(serviceKey);
	}

	public UAccountServiceKey getByAccountId(String accountId){
		return accountServiceKeyDao.selectByAccountId(accountId);
	}
}
